package com.lucy.disk.controller;

import com.lucy.common.domain.ResponseDTO;
import com.lucy.disk.minio.utils.MinioUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
@RestController
@RequestMapping("oss")
@Api(tags = "对象存储")
public class MinioController {
    @Autowired
    MinioUtil minioUtil;

    @GetMapping("buckets")
    @ApiOperation(value = "存储桶列表")
    public ResponseDTO<Object> BucketsList() throws Exception {
        return ResponseDTO.succData(
          minioUtil.getAllBuckets()
        );
    }

}
